# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=shard
pkgver=1.5
pkgrel=2
pkgdesc='A command line tool to detect shared passwords.'
groups=('blackarch' 'blackarch-recon')
arch=('any')
url='https://github.com/philwantsfish/shard/releases'
license=('MIT')
depends=('java-environment')
makedepends=('git')
source=("https://github.com/philwantsfish/shard/releases/download/$pkgver/$pkgname-$pkgver.jar")
noextract=("shard-$pkgver.jar")
sha512sums=('74e9b3fad1786b58853f89ce7615ad7dee0a33d9cee8fb5a78b7ffdefc8f003988a17a72073e2fc286820c2c5a4220511a582cc533e2f5c444875c436153e1b1')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 -t "$pkgdir/usr/$pkgname/$pkgname/" "$pkgname-$pkgver.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

